package implicitCon

/**
  * Created by feng on 11/12/2018.
  */
class MissLeft[T:Ordering] {

  def choose(first:T,sencond:T):T={
    val ord = implicitly[Ordering[T]]
    if(ord.gt(first,sencond)) first else sencond
  }

}

object MissLeft{

  def main(args: Array[String]): Unit = {
//
    import implicitCon.MyPreDef.girtOrdering
    val m1 = new MissLeft[Girl]
    val g1 = new Girl("hh",90,23)
    val g2 = new Girl("aa",92,25)

    val g = m1.choose(g1,g2)

    println(g.name)

  }
}
